package com.zho.util.exception;

public class BaseException extends RuntimeException {
    private String location = null;
    private String errorCode = null;

    private Throwable throwable = null;

    public BaseException() {
        super();
    }

    public BaseException(String description) {
        super(description);
    }

    public BaseException(String location, String description) {
        super(description);
        this.location = location;
    }

    public BaseException(String location, Throwable throwable) {
        super(throwable.getMessage());
        this.location = location;
        this.throwable = throwable;
    }

    public String getLocation() {
        return location;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public String getLocationMessage() {
        return location + ": " + getMessage();
    }

    /**
     * @return the errorCode
     */
    public String getErrorCode() {
        return this.errorCode;
    }

    /**
     * @param errorCode
     *            the errorCode to set
     */
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}
